#include "codon.h"
#include "dbOperation.h"
#include <stdio.h>
#include<time.h>

clock_t start,stop;    /*clock_t is a built-in type for processor time (ticks)*/
double TotalTime;    /*records the run time (seconds)of a function*/
double Ticks;   /*use to save the ticks of computer*/

//main function
int main()
{
	db codonDB;
	codonDB.AddSpecies("Escherichia_coli1.txt");
	codonDB.AddSpecies("Homo_sapiens2.txt");
	//codonDB.Select();
	codonDB.CreateTable();

	//records the ticks at the beginning of insert
	start=clock();       
	codonDB.InsertCodon();
	//records the ticks at the end of insert
	stop=clock();
	Ticks=(double)(stop-start);
	TotalTime=((double)(stop-start))/CLK_TCK;
	printf("insert cost time: %lf\n", TotalTime);
/*
	codonDB.SetSpeciesCount();
	codonDB.RankTableCal();
	
	//codonDB.translateRNAFromFile("protein1.txt", 1);
	codonDB.translateRNAFromFile("RNA1.txt", 1);
	codonDB.speciesRNATransform(2);
	codonDB.printSequences();
	//codonDB.ExecSql("delete from codonUsage;");
*/
	return 0;
}
